import { request } from "~/utils/http";
import type { IPermission } from "../login/type";

export const apiPermissionTree = (): Promise<IPermission[]> =>
  request.get("/permissions/tree");

export const apiAddPermission = (data: Partial<IPermission>) =>
  request.post("/permissions", data);

export const apiModifyPermission = (id: number, data: Partial<IPermission>) =>
  request.put(`/permissions/${id}`, data);
